package com.dc.entity.special;


import com.dc.entity.ShipRepairEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 * 0 船体下料  宇右和凯粤
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_2_ship_cut")
public class WorkflowSpecial2ShipCutEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "ship_repair_id", columnDefinition = "bigint unsigned NOT NULL", insertable = false, updatable = false)
    private Long shipRepairId;      // 维修记录 外键id

    @Column(name = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date submitTime;        // 填写日期

    @Column(name = "ship_name", length = 50)
    private String shipName;        // 船体名称

    @Column(name = "reporter", length = 20)
    private String reporter;        // 填报人

    ////////////////////////////////////////////////////////////////////////////////////
    @Column(name = "no", length = 50)
    private String no;              // 切割文件号

    @Column(name = "length")
    private Double length;          // 切割长度

    @Column(name = "type", length = 20)
    private String type;            // 钢板类型

    @Column(name = "weight")
    private Double weight;          // 厚度

    @Column(name = "device_type", length = 10)
    private String deviceType;      // 设备类型

    @Column(name = "device_no", length = 20)
    private String deviceNo;        // 设备型号

    @Column(name = "start_power")
    private Double startPower;      // 电表起始读数

    @Column(name = "end_power")
    private Double endPower;        // 电表结束读数

    @Column(name = "powers")
    private Double powers;          // 用电量

    @Column(name = "start_o2")
    private Double startO2;         // 氧气起始读数

    @Column(name = "end_o2")
    private Double endO2;           // 氧气结束读数

    @Column(name = "o2")
    private Double o2;              // 耗氧气量(m³)

    @Column(name = "start_air")
    private Double startAir;        // 压缩空气开始读数

    @Column(name = "end_air")
    private Double endAir;          // 压缩空气结束读数

    @Column(name = "air")
    private Double air;             // 耗压缩空气量(m³)

    ////////////////////////////////////////////

    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_repair_id")
    private ShipRepairEntity shipRepairEntity;

}